import { createRouter, createWebHistory } from "vue-router";
import HomeView from "../views/HomeView.vue";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // 首页
    {
      path: "/",
      name: "home",
      component: HomeView,
    },
    // 关于
    {
      path: "/about",
      name: "about",
      component: () => import("../views/AboutView.vue"),
    },
    // 分类
    {
      path: "/Classify",
      name: "Classify",
      component: () => import("../views/ClassifyView.vue"),
    },
    // 购物车
    {
      path: "/Cart",
      name: "CartView",
      component: () => import("../views/CartView.vue"),
    },
    // 个人中心
    {
      path: "/Mine",
      name: "Mine",
      component: () => import("../views/MineView.vue"),
    },
    // 登录
    {
      path: "/Login",
      name: "Login",
      component: () => import("../views/LoginView.vue"),
    },
    // 注册
    {
      path: "/Register",
      name: "Register",
      component: () => import("../views/RegisterView.vue"),
    },
    // 商品详情
    {
      path: "/Detail",
      name: "Detail",
      component: () => import("../views/DetailView.vue"),
    },
    // 小程序A首页
    {
      path: "/SmallAppA",
      name: "SmallAppA",
      component: () => import("../views/SmallAppA/SmallAppA.vue"),
    },
    {
      path: "/SmallAppB",
      name: "SmallAppB",
      component: () => import("../views/SmallAppB/SmallAppB.vue"),
    },
  ],
});

export default router;
